




document.write("run head.js :当你把脚本放置到 head 部分后，就可以确保在需要使用脚本之前，它已经被载入了。")

window.onload = function() 
{
	var element = document.getElementById('choices');
	var anchors   = element.getElementsByTagName('a');
	for (var i=0; i < anchors.length; i++ ) 
		{
			anchors[i].onclick = popUpResult;
		}
}

 popUpResult = function(evt)
 { 
 	var src = evt.srcElement; 
 	var id = src.getAttribute("id"); 
 	var result;   
 	if (id=='rock') 
 		{result = "tie"; } 
 	if (id=='paper') 
 		{result = "win"; }   

 	if (id=='scissors') 
 		{result = "lose"; }      

 	newWindow = open("","","top=200,left=200,height=200,width=400");
 	newWindow.document.write("You " + result + "!");
 }  

checkForm  = function()
{

	var f = document.getElementById("f").value;
	var l = document.getElementById("l").value;
	alert(f + l)
}



